package com.leetcode.August;

/**
 * @Description: 122. 买卖股票的最佳时机 II
 * @Author: Mr.Fxy
 * @CreateTime: 2024-08-18 16:31
 */
public class LC122买卖股票的最佳时机II {
    public int maxProfit(int[] prices) {
        int revenue = 0;
        for (int i = 1; i < prices.length; i++) {
            if(prices[i]>prices[i-1])
                revenue += prices[i]-prices[i-1];

        }
        return revenue;
    }
}
